<%--

<!------------------------------------------------------------------------------
 - Copyright 2006 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   COMPANY
 - AUTHOR           :   Victor Zheng 
 - DATE CREATE      :   2006/02/01
 - DESCRIPTION      :   a MAINTENANCE CONTENT JSP file for the function, COMPANY
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2006/02/01   Victor Zheng    1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page import="com.erp.app.admin.companySetup.vo.CompanyVo"%>
<%@ page import="com.erp.app.admin.companySetup.web.CompanyMaintenanceAction"%>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="companyMaintenanceForm" scope="session" type="com.erp.app.admin.companySetup.web.CompanyMaintenanceForm" />

<script language="javascript">

	function doViewImage(pageEvent) {
		var w = window.open("companyMaintenance.do?pageEvent=" + pageEvent, "view", "toolbar=no,scrollbars=1,resizable=1,statusbar=no,menubar=no,width=640,height=400,top=0,left=0");
	}

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}
		%>

		<%
		String lastAction = CommonUtil.nullToString(companyMaintenanceForm.getPageEvent());
		if (lastAction.equalsIgnoreCase(CompanyMaintenanceAction.ACTION_ADD_COMP_LOGO)) {
			out.println(WebUtil.openUploadFileDo());
		}
		%>
	}

</script>

<body onLoad="javascript:doLoad();">
<html:form action="/companyMaintenance">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>
<html:hidden property="deleteIdx"/>
<html:hidden property="pageEventSrc"/>

<table class="table_button">

<tr>
	<td>
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_CREATE%>"
			styleClass="button1"/>
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_SAVE%>"
			styleClass="button1"/>
	<logic:notEqual name = "companyMaintenanceForm" property = "pageMode" value = "<%=companyMaintenanceForm.PAGE_MODE_CREATE%>">
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_REFRESH%>"
			styleClass="button1"/>
		<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_DELETE%>"
			styleClass="button1"/>
	</logic:notEqual>
	</td>
</tr>

</table>

<font color='red'><html:errors /></font>

<logic:equal name="companyMaintenanceForm" property="folderIdx" value="0">
	<jsp:include page="CompanyTab.jsp" flush="true"/>
</logic:equal>


</html:form>
